package domain;
public class ProcessorFactory {
    public enum Type {SINGLECORE, MULTICORE};
   
    static Processor create(ProcessorFactory.Type type, String speed) {
        if (type == Type.SINGLECORE) {
            return new SingleCoreProcessor(speed);
        } else {
            return new MultiCoreProcessor(speed);
        }
    }
   
    static Processor create(String size, boolean multicore) {
        return ProcessorFactory.create(multicore ? Type.MULTICORE : Type.SINGLECORE, size);
    }
    
    private ProcessorFactory() {}
}
